package com.j283_5.wisdom_park.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000119644994";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCREAiWuDhPpGHLLvpuRvHsQqdagc5wEyC9xOAhVCJqXshSmqmObH2Jf9iBBFxjYcmpQfxVgQ8flQw8dMS9heIQuM1h5YuJpikwkevCWFmgiR9sdle0+vNTFXuLMbvTL42ddyzW0n2LazU6Lc2iEho1RLJciFun/v7paiHOQjSkQXJRQt1Fai3PtHLvrnRS4/HynlRyWhpczBpyeCka6f75SCpqgtYw2+A3QvXCtWKspBG6NiKAzJC2D+Pq3n6tomVQ7qcCAysYAr8CbAdfwnY2p/xNiL0bb8PBwH2mHm6BzarDvbF+bYUhHGvVXqLNL4bycSYBZtPeHc5ZMxbESJyXAgMBAAECggEAOKc1Y3+g5mHBm7PGNGlatDW33F4TvKuLvvFzwzBznG1V+QTUMX5nbNrUOFb2qg2Xz5WosdAMkv4H4FiOOaJfDr7N32zhmSmeroxesfEFV/AVqKtzR4g2nX0nWc5bl3fb6+KOTXu5cki1afpXc/Nz7tfcfMz4Vtz8uzYq673phzg8t9JfuivAJfbESbd7CYUMsiUpNF5MSDnqbu44YiVebIL7nELYViS6lAQ1MOTb9+MuaDtEb/ZQJQpNIoKL7zxuygFk5nNx8Y9LR5Jx6pNgQ3ObjNITcDZrJGo3w7CKaT2rFR9WWQTvUgNHk4nhOTQNfAQlIGspOv04ro7pwmDe+QKBgQDXLMcUUatdCuxiTescdbDc4RubQW2WOLQSYa9eH6lW4wA0Vfu7c5zwLPiAp5ZdqQu3z4JF92Zuc9sOQnJa75TMDPk97JhiTSgUkO4rG4spX8wfeICRbeViqjQsmsjF3w7iokPVbb25DPYuBO2WBC2eMlgT0Ef7GQUBGVw3VkLNJQKBgQCsldhB7ijVQJ3VjjYoeYyY/gIdYqiYrgTSN3IDR16yXsf8Kz9k+94Pv7p6LQi/IgeR7HI40ou1yK2dzxK6S0HMc3nglqs+NI1sHMxANz2VPsKq7Zm3aYx3U/dgLZu2HtvS/rcMAEAsByktF8A/byrKUFHe5/5LPaLKwEdKo0bcCwKBgGd/h0Zzvgxj662hMvyec3La6C92eiKupZbN289XRVmgmIGT9iCFDLDNwL4JXh8w540DR/Mle+SW33/tYBnzcUvw1ZX+jpGB8UxrJdQgTICbLpDYombRSGt72Nq3nOjoUL2cNSqcvYwb+vHJtwnYeqTELG9jWKwjra+Ipj2LxVftAoGAESrKmyxMhYHq8U43FumYUbOalD+3E5Djy+FWBvt3cPi6ndvTb4EaQqjIrNSD9Tc2V46UghB3czqmAneRnlRUFDk8W1nBaOujUai/rHeSOaFHjecajkMChPAmQDvpLEF/jkpl/NydhYOk1eZx6h1tvTgmHK0o/2T/J3ne3Y7GQqcCgYEAvV8AMD7BZpuwF6Uz6BSF2k7amhVTInt8ZDK2AXaptZUr4Db3PU85gSdKu9G70wDs64j6TclE1J4y+nHvuGCCLdsx8MRUbXBdggZs3FKjr72AkBkM+10ZW+j0RtKFxuuyVezkHFghB+zWJbrrdn/e4676kEL7fDflt7NGgxmA9YY=";
    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArt7cLghlfiBFMrTaffmkUeBRK0+oKYXTcfjyJzmYoF/+X+SvfegmYIfB4qv2aeN1oGEDzDV+m4bGxP6XauDVc4+ic5/f2lcAXD4Pe2uu8tLD01qobpz1UiByshQ2/66fAadlIAMk/snRDm2F1kVz2slJGjygZ5lH6PB7B0vdvhcU6IRBYM+nFIVRffB+iu9QoIJfxf3zaa5KhkyzDvHk1KG3eH/+z8O5gS4cgbvJLQ5D9MLcsTXPfSzdQ+H9F4dULa9oJjotDlb2VSRDeXSdgyji1kw3qBEMg8kxDJ36JadroCc4cUp8T/vz0wdSTk2MxJM4oYjB4+fH8OOtLWDgqwIDAQAB";
    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8080/notify_url.jsp";
    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8080/choiceManager.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关 支付宝网关名-正式环境
    //public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
    //支付宝网关名-沙箱环境
    public static final String gatewayUrl="https://openapi.alipaydev.com/gateway.do";
    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

